<template>
  <div class="cesiumCommon">
    <GlobalCesium />
  </div>
</template>

<script lang="ts" setup>
import { onMounted } from "vue";
import { getGlobalViewer, GlobalCesium } from "@/components/GlobalCesium";
import { addMapData } from "./cesium-event/addMapData";
import { Cartesian3 } from "@space8/czm-plugin";

defineOptions({ name: "CesiumCommon" });
onMounted(() => {
  const viewer = getGlobalViewer();
  viewer.camera.flyTo({
    destination: new Cartesian3(
      -2607063.9590401757,
      4724283.682639121,
      3392450.315553901
    ),
    orientation: {
      heading: 6.283185307179547,
      pitch: -0.5004702988469303,
      roll: 6.283185307179586,
    },
  });
  addMapData(viewer);
});
</script>

<style lang="less" rel="stylesheet/less" scoped>
.cesiumCommon {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  // z-index: 2;
}
</style>
